WebTextEditor provides a method to save the content to a document during server-side event.
In this topic, you will learn how to save a document.
To save document to WebTextEditor
- Set the EnableDocumentSave property in the WebTextEditor to True. This will add a new command, Save Command, to the WebTextEditor toolbar.
- Call SaveContentToFile method during onSave WebTextEditor server side event. Here is the snippet:
C#
Copy Codeprotected void WebTextEditor1_Save(object sender, WebTextEditorSaveArgs e) { WebTextEditor1.SaveContentToFile(HttpContext.Current.Server.MapPath("./SampleHtml/SavedFile.html"), WebTextEditorHtmlDocType.XHTMLDocType); }